package com.example.annotation;

import androidx.appcompat.app.AppCompatActivity;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;

import com.example.annitaions.szjFind;
import com.example.annotation.bean.UserBean;
import com.example.annotation.utils.szjAnnotationUtil;

@SuppressLint("NonConstantResourceId")
public class MainActivity extends AppCompatActivity {

    @szjFind(R.id.bt)
    Button bt;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //注册
        szjAnnotationUtil.getInstance().initFind(this);


        bt.setText("跳转到第二个页面");

        bt.setOnClickListener(v -> {

            Intent intent = new Intent(MainActivity.this, MainActivity2.class);
            intent.putExtra("id", 12);
            intent.putExtra("name", "szj");
            intent.putExtra("sex", true);
            intent.putExtra("userBean", new UserBean());
            startActivity(intent);

        });
    }
}